{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import torch\n",
    "import torchvision\n",
    "import torch.utils.data as data\n",
    "import matplotlib.pyplot as plt\n",
    "from torchvision import transforms\n",
    "%matplotlib inline\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "torch.Size([1, 28, 28])"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 读取数据\n",
    "train_data = torchvision.datasets.FashionMNIST(root=\"../../data\",train=True,transform=transforms.ToTensor())\n",
    "test_data = torchvision.datasets.FashionMNIST(root=\"../../data\",train=False,transform=transforms.ToTensor())\n",
    "train_data[0][0].shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "n_inputs = 784\n",
    "n_hidden = 256\n",
    "n_output = 10\n",
    "net = torch.nn.Sequential(torch.nn.Flatten(),\n",
    "                          torch.nn.Linear(n_inputs,n_hidden),\n",
    "                          torch.nn.ReLU(),\n",
    "                          torch.nn.Linear(n_hidden,n_output)\n",
    "                          )"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "batch_size = 256\n",
    "lr =0.03\n",
    "epochs = 10\n",
    "loss = torch.nn.CrossEntropyLoss()\n",
    "optim = torch.optim.SGD(net.parameters(),lr)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "train_iter = data.DataLoader(train_data,batch_size,shuffle=True)\n",
    "test_iter = data.DataLoader(test_data,batch_size, shuffle=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "def train():\n",
    "    for epoch in range(epochs):\n",
    "        for x,y in train_iter:\n",
    "            y_hat = net(x)\n",
    "            l = loss(y_hat, y)\n",
    "            optim.zero_grad()\n",
    "            l.backward()\n",
    "            optim.step()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "train()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "def accuracy(y_hat:torch.Tensor, y):\n",
    "    fin_output = y_hat.argmax(dim=1)\n",
    "    cmp = fin_output.type(y.dtype) == y\n",
    "    return float(cmp.type(y.dtype).sum())/len(y)\n",
    "def emulate():\n",
    "    num = 0\n",
    "    sum = 0\n",
    "    net.eval()\n",
    "    for x,y in test_iter:\n",
    "        sum += accuracy(net(x),y)\n",
    "        # print(accuracy(net(x),y))\n",
    "        num += 1\n",
    "    return sum/num"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.83251953125"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "emulate()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "import random\n",
    "def show_img(img:torch.Tensor, rows = 28, cols = 28): # 显示图片\n",
    "    plt.imshow(img.reshape((rows, cols)),cmap=\"gray\")\n",
    "def get_fashion_mnist_labels(labels):  \n",
    "    \"\"\"返回Fashion-MNIST数据集的文本标签输入是多个标签\"\"\"\n",
    "    text_labels = ['t-shirt', 'trouser', 'pullover', 'dress', 'coat',\n",
    "                   'sandal', 'shirt', 'sneaker', 'bag', 'ankle boot']\n",
    "    return [text_labels[int(i)] for i in labels]\n",
    "def emulate_vision():\n",
    "    length = len(test_data)\n",
    "    rand = int(random.random()*length)\n",
    "    print(\"sample:\",rand)\n",
    "    o = net(test_data[rand][0])\n",
    "    y_hat = o.argmax()\n",
    "    show_img(test_data[rand][0])\n",
    "    y = test_data[rand][1]\n",
    "    print((y_hat==y).item())\n",
    "    print(f\"predict:{get_fashion_mnist_labels([y_hat])[0]}\\nactrully:{get_fashion_mnist_labels([y])[0]}\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "sample: 1687\n",
      "True\n",
      "predict:dress\n",
      "actrully:dress\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAaAAAAGdCAYAAABU0qcqAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8pXeV/AAAACXBIWXMAAA9hAAAPYQGoP6dpAAAft0lEQVR4nO3db2yV9f3/8ddpaQ8F2lPb0n+jYEGFyZ9uolSmIoYGqIkRYYuoN8AYiK6YIXOaLio6l3Vi4pdoGGY3JjMRUROBaDY2BVvmVlhACSObFWodMGgRtOeUAm1pr98NfnY7AsLnQ0/fbXk+kpPQc86r16dXr/Lq1XP13VAQBIEAAOhlSdYLAABcniggAIAJCggAYIICAgCYoIAAACYoIACACQoIAGCCAgIAmBhkvYBv6urq0qFDh5Senq5QKGS9HACAoyAI1NLSosLCQiUlnf88p88V0KFDh1RUVGS9DADAJTpw4IBGjBhx3sf7XAGlp6dbLwEJVFJS4px58sknnTPXXnutc0aStmzZ4pypr693zrS1tTlnhg4d6py57rrrnDOSVFBQ4Jx5+umnnTPV1dXOGfQfF/r/PGEFtGrVKj3//PNqbGxUSUmJXnrpJU2ZMuWCOX7sNrAlJyc7Z3z+4/X9RiYtLc05Ew6HvbbVG9sZMmSI17aGDRvmnBk0qM99PwtjF/r/PCEXIbzxxhtatmyZli9fro8++kglJSWaNWuWjhw5kojNAQD6oYQU0AsvvKBFixbp/vvv17XXXquXX35ZQ4YM0e9+97tEbA4A0A/1eAG1t7dr586dKisr++9GkpJUVlam2tras57f1tamWCwWdwMADHw9XkBHjx5VZ2en8vLy4u7Py8tTY2PjWc+vqqpSJBLpv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DgrrvuCg4fPmy36AS40H7Yv39/MG3atCArKysIh8PBVVddFfzsZz8LotGo7cK/gT/HAAAw0edfAwIADEwUEADABAUEADBBAQEATFBAAAATFBAAwAQFBAAwQQEBAExQQAAAExQQAMAEBQQAMEEBAQBM/D9REVrweoJOwgAAAABJRU5ErkJggg==",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "emulate_vision()"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "base",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
